Skip to main content
GET
/
v1
/
tasks
/
{task_id}
/
thread
Get Task'S Thread
curl --request GET \
  --url https://api.xpander.ai/v1/tasks/{task_id}/thread \
  --header 'x-api-key: <api-key>'
[
  {}
]
Retrieve the complete conversation thread for a task, including all messages and agent responses.

Path Parameters

task_id
string
required
Unique identifier of the task (UUID format)

Response

Returns an array of message objects representing the conversation thread:
[array]
array
Array of conversation messages

Example Request

curl -X GET -H "x-api-key: YOUR_API_KEY" \
  https://api.xpander.ai/v1/tasks/60ce6693-9c4d-45a0-a675-76cd8cbefbac/thread

Example Response

[
  {
    "id": "ad8a9e63-e23c-41ec-9b6a-efb472d51fbc",
    "role": "user",
    "content": "What is 5+5?",
    "name": null,
    "tool_call_id": null,
    "tool_calls": null,
    "audio": null,
    "images": null,
    "videos": null,
    "files": null,
    "audio_output": null,
    "image_output": null,
    "video_output": null,
    "file_output": null,
    "redacted_reasoning_content": null,
    "provider_data": null,
    "citations": null,
    "reasoning_content": null,
    "tool_name": null,
    "tool_args": null,
    "tool_call_error": null,
    "stop_after_tool_call": false,
    "add_to_agent_memory": true,
    "from_history": false,
    "metrics": {
      "input_tokens": 0,
      "output_tokens": 0,
      "total_tokens": 0,
      "audio_input_tokens": 0,
      "audio_output_tokens": 0,
      "audio_total_tokens": 0,
      "cache_read_tokens": 0,
      "cache_write_tokens": 0,
      "reasoning_tokens": 0,
      "timer": null,
      "time_to_first_token": null,
      "duration": null,
      "provider_metrics": null,
      "additional_metrics": null
    },
    "references": null,
    "created_at": 1762463339
  },
  {
    "id": "9c4313f6-b8f0-48aa-9b5c-478ac60104aa",
    "role": "assistant",
    "content": "5 + 5 = 10",
    "name": null,
    "tool_call_id": null,
    "tool_calls": null,
    "audio": null,
    "images": null,
    "videos": null,
    "files": null,
    "audio_output": null,
    "image_output": null,
    "video_output": null,
    "file_output": null,
    "redacted_reasoning_content": null,
    "provider_data": null,
    "citations": null,
    "reasoning_content": null,
    "tool_name": null,
    "tool_args": null,
    "tool_call_error": null,
    "stop_after_tool_call": false,
    "add_to_agent_memory": true,
    "from_history": false,
    "metrics": {
      "input_tokens": 296,
      "output_tokens": 8,
      "total_tokens": 304,
      "audio_input_tokens": 0,
      "audio_output_tokens": 0,
      "audio_total_tokens": 0,
      "cache_read_tokens": 0,
      "cache_write_tokens": 0,
      "reasoning_tokens": 0,
      "timer": null,
      "time_to_first_token": null,
      "duration": null,
      "provider_metrics": null,
      "additional_metrics": null
    },
    "references": null,
    "created_at": 1762463339
  }
]

Use Cases

  • View conversation history - See the complete interaction between user and agent
  • Track token usage - Monitor LLM API costs per message
  • Debug agent responses - Analyze what the agent said and why
  • Audit conversations - Review interaction history for compliance

Notes

  • Returns only the root task’s messages (excludes sub-tasks)
  • For multi-agent workflows with sub-tasks, use [Get Task Thread (Full)](/API reference/v1/tasks/get-thread-full)
  • Token metrics help track LLM API costs per message

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

task_id
string
required

Response

Successful Response

The response is of type object[].